package com.ruoyi.web;

import com.zgl.youshuda.core.domain.MksUser;
import com.zgl.youshuda.core.service.BusinessSysService;
import com.zgl.youshuda.core.service.procservice.util.callservice.domain.Result;
import com.zgl.youshuda.core.utils.CommonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("callServiceDemo")
public class CallServiceDemo {

    @Autowired
    private BusinessSysService businessSysService;

    /**
     * 调用Spring方法，获取当前用户信息
     * @return Result 处理结果对象
     * @throws Exception
     */
    public Result getUserInfo() {
        try {
            MksUser user = businessSysService.getUser();
            return Result.ok(user,"获取成功");
        } catch (Exception e) {
            return Result.fail("未获取到用户信息");
        }
    }

    /**
     * 调用Java方法
     * @throws Exception
     */
    public String callJavaFun() {
        return callJavaFun("无传参数");
    }
    public String callJavaFun(String params) {
        return "参数信息【"+params+"】"+CommonUtil.getUUID();
    }

}
